package com.ftg.learn.chapter08;

import cn.hutool.extra.mail.MailAccount;
import cn.hutool.extra.mail.MailUtil;

/**
 * @author kangjx
 * @createTime 2022/11/11
 */
public class LearnMail {

    /**
     * 邮件发送功能
     * @param args
     */
    public static void main(String[] args) {
        //第一种方式
        MailAccount mailAccount = new MailAccount();
        mailAccount.setHost("smtp.163.com");
        mailAccount.setFrom("lovexyyy@163.com");
        mailAccount.setPass("BAIVAYMWHWLMPYLB");
        MailUtil.send(mailAccount,"lovexyyy@163.com","test","测试邮件...",true,null);
        //第二种方式
        MailUtil.send("lovexyyy@163.com","test","测试邮件...",true,null);
    }

}
